Tell me what's wrong [closed]

Posted by steve care on Stack Overflow See other posts from Stack Overflow or by steve care
Published on 2012-07-01T02:59:39Z Indexed on 2012/07/01 3:15 UTC
Read the original article Hit count: 82

Filed under:
|
|
|

public class Sample {

public static void main (String[]a){

 int[] x;
 x = new int[10];
 int i;'
 int n=0;
  for (i=0;i<=10;i++){
      n++;
      x[i]=n;
      System.out.print(x[i] + " ");
 }

} }

the problem is I got an error of "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10"

© Stack Overflow or respective owner

Related posts about java

Related posts about multithreading